<template>
    <div class="box">
        <div class="header">
            <van-search v-model="value" show-action placeholder="请输入搜索内容" @search="onSearch"
                @update:model-value="onUpdate">
                <template #action>

                </template>
            </van-search>
        </div>
        <div class="meddle">

            <van-empty v-if="item.length == 0" :image="search" image-size="80" description="搜不到" +value/>
            <van-card v-else :num="item.count" :price="item.price" :title="item.title" :thumb="item.image" />


        </div>
    </div>
</template>
<script setup>

 import { ref, onMounted } from "vue";
import request from '@/utils/request.js'
    const list=ref([])
    const value=ref('')
    const onUpdate=()=>{
        request.get('/search',{
            params:{
                value:value.value
            }
        }).then(res=>{
            if(res.data.code==200){
                list.value=res.data.data
            }
        })
    }
</script>